#include<stdbool.h>

bool strongPasswordCheckerII(char *password)
{
    int i, mask = 0;

    if (strlen(password) < 8)
        return false;

    for (i = 0; password[i]; i++)
    {
        if (password[i] == password[i + 1])
            return false;
        if (password[i] >= 'A' && password[i] <= 'Z')
            mask |= 1;
        else if (password[i] >= 'a' && password[i] <= 'z')
            mask |= 2;
        else if (password[i] >= '0' && password[i] <= '9')
            mask |= 4;
        else if (strchr("!@#$%%^&*()-+", password[i]))
            mask |= 8;
    }
    return mask == 0xf;
}